<template>
  <div id="app">
    <nav>
      <!-- <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link> -->
      <button @click="toPage('/home')">首页</button> |
      <button @click="toPage('/about')">关于</button> |
      <button @click="toPage('/user/1')">用户1</button> |
      <button @click="toPage('/user/2')">用户2</button> |
      <button @click="toPage('/profile')">个人信息</button> 
    </nav>
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  components: {},
  methods: {
    toPage(path) {
      this.$router.push(path);
    },
  },
};
</script>


<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
  .active {
    color: red;
  }
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
